home *** CD-ROM | disk | FTP | other *** search
- Listing 2 - The example from the C++ draft standard
- illustrating the class scope rules.
-
- typedef int c;
- enum { i = 1 };
-
- class X
- {
- char v[i]; // error: 'i' refers to ::i
- // but when reevaluated is X::i
- int f() { return sizeof(c); } // okay: X::c
- char c;
- enum { i = 2 };
- };
-
- typedef char* T;
- struct Y
- {
- T a; // error: 'T' refers to ::T
- // but when reevaluated is Y::T
- typedef long T;
- T b;
- };
-
-